import Vue from 'vue'
import VueRouter from 'vue-router'
import Upload from '../views/Upload.vue'
import Login from '../views/Login.vue'
import MainMenu from '../views/MainMenu.vue'
import GameController from '../views/GameController.vue'
import GameOver from '../views/GameOver'
import Test from '../views/Test.vue'
import SendMsgAll from '../views/SendMsgAll.vue'

Vue.use(VueRouter)

const routes = [
  
  {
    name: 'login',
    path: '/',
    component: Login
  },
  {
    name: 'test',
    path: '/',
    component: Test
  },
  {
    name: 'sendmsg',
    path: '/sendmsg',
    component: Upload
  },
  {
    name: 'sendmsgall',
    path: '/sendmsgall',
    component: SendMsgAll
  },
  {
    name: 'home',
    path: '/home',
    component: MainMenu
  }, {
    name: 'quiz',
    path: '/quiz',
    component: GameController,
    props: (route) => ({ 
      number: route.query.number, 
      difficulty: route.query.difficulty, 
      category: route.query.category,
      type: route.query.type
    })
  }, {
    name: 'result',
    path: '/result',
    component: GameOver
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
